import request from "@/utils/request";

// 简单学科列表
export function getSimple(params) {
  return request({
    url: "/subjects/simple",
    method: "get",
    params
  });
}

// 全部题库内容
export function getQuestions(params) {
  return request({
    url: "/questions/choice",
    method: "get",
    params
  });
}

// 获取目录
export function getCatalogue(id) {
  return request({
    url: `/directorys/${id}`,
    method: "get"
  });
}

// 获取目录列表

export function getdirectorys(params) {
  return request({
    url: "/directorys",
    method: "get",
    params
  });
}

// 题库详情

export function getparticulars(id) {
  return request({
    url: `/questions/${id}`,
    method: "get"
  });
}

// 添加题库
export function addquestions(data) {
  return request({
    url: "/questions",
    method: "post",
    data
  });
}
// 修改
export function editquestions(data) {
  return request({
    url: `/questions/${data.id}`,
    method: "put",
    data
  });
}
// // 企业管理列表
// export function getcompanyslist(params) {
//   return request({
//     url: "/companys",
//     method: "get",
//     params
//   });
// }

// 删除题库
export function delquestions(id) {
  return request({
    url: `/questions/${id}`,
    method: "delete"
  });
}

// 上架下架
export function pushquestions(data) {
  return request({
    url: `/questions/choice/${data.id}/${data.publishState}`,
    method: "post"
  });
}

// 审核
export function getcheck(data) {
  return request({
    url: `/questions/check/${data.id}`,
    method: "post",
    data
  });
}

// 获取标签

export function getTags(params) {
  return request({
    url: "tags/simple",
    method: "GET",
    params
  });
}
